\(\int \frac {\tan ^5(c+d x)}{a+i a \tan (c+d x)} \, dx\) [46]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 109 \[ \int \frac {\tan ^5(c+d x)}{a+i a \tan (c+d x)} \, dx=-\frac {5 i x}{2 a}+\frac {2 \log (\cos (c+d x))}{a d}+\frac {5 i \tan (c+d x)}{2 a d}+\frac {\tan ^2(c+d x)}{a d}-\frac {5 i \tan ^3(c+d x)}{6 a d}-\frac {\tan ^4(c+d x)}{2 d (a+i a \tan (c+d x))} \]

[Out]

-5/2*I*x/a+2*ln(cos(d*x+c))/a/d+5/2*I*tan(d*x+c)/a/d+tan(d*x+c)^2/a/d-5/6*I*tan(d*x+c)^3/a/d-1/2*tan(d*x+c)^4/
d/(a+I*a*tan(d*x+c))

Rubi [A] (verified)

Time = 0.14 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3631, 3609, 3606, 3556} \[ \int \frac {\tan ^5(c+d x)}{a+i a \tan (c+d x)} \, dx=-\frac {\tan ^4(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {5 i \tan ^3(c+d x)}{6 a d}+\frac {\tan ^2(c+d x)}{a d}+\frac {5 i \tan (c+d x)}{2 a d}+\frac {2 \log (\cos (c+d x))}{a d}-\frac {5 i x}{2 a} \]

[In]

Int[Tan[c + d*x]^5/(a + I*a*Tan[c + d*x]),x]

[Out]

(((-5*I)/2)*x)/a + (2*Log[Cos[c + d*x]])/(a*d) + (((5*I)/2)*Tan[c + d*x])/(a*d) + Tan[c + d*x]^2/(a*d) - (((5*
I)/6)*Tan[c + d*x]^3)/(a*d) - Tan[c + d*x]^4/(2*d*(a + I*a*Tan[c + d*x]))

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3606

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[b*d*(Tan[e + f*x]/f), x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3631

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*
c - a*d)*((c + d*Tan[e + f*x])^(n - 1)/(2*a*f*(a + b*Tan[e + f*x]))), x] + Dist[1/(2*a^2), Int[(c + d*Tan[e +
f*x])^(n - 2)*Simp[a*c^2 + a*d^2*(n - 1) - b*c*d*n - d*(a*c*(n - 2) + b*d*n)*Tan[e + f*x], x], x], x] /; FreeQ
[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[n, 1]

Rubi steps \begin{align*} \text {integral}& = -\frac {\tan ^4(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {\int \tan ^3(c+d x) (4 a-5 i a \tan (c+d x)) \, dx}{2 a^2} \\ & = -\frac {5 i \tan ^3(c+d x)}{6 a d}-\frac {\tan ^4(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {\int \tan ^2(c+d x) (5 i a+4 a \tan (c+d x)) \, dx}{2 a^2} \\ & = \frac {\tan ^2(c+d x)}{a d}-\frac {5 i \tan ^3(c+d x)}{6 a d}-\frac {\tan ^4(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {\int \tan (c+d x) (-4 a+5 i a \tan (c+d x)) \, dx}{2 a^2} \\ & = -\frac {5 i x}{2 a}+\frac {5 i \tan (c+d x)}{2 a d}+\frac {\tan ^2(c+d x)}{a d}-\frac {5 i \tan ^3(c+d x)}{6 a d}-\frac {\tan ^4(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {2 \int \tan (c+d x) \, dx}{a} \\ & = -\frac {5 i x}{2 a}+\frac {2 \log (\cos (c+d x))}{a d}+\frac {5 i \tan (c+d x)}{2 a d}+\frac {\tan ^2(c+d x)}{a d}-\frac {5 i \tan ^3(c+d x)}{6 a d}-\frac {\tan ^4(c+d x)}{2 d (a+i a \tan (c+d x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.54 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.97 \[ \int \frac {\tan ^5(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {-12 i \log (\cos (c+d x))+3 (5+4 \log (\cos (c+d x))) \tan (c+d x)+9 i \tan ^2(c+d x)+\tan ^3(c+d x)-2 i \tan ^4(c+d x)-15 i \arctan (\tan (c+d x)) (-i+\tan (c+d x))}{6 a d (-i+\tan (c+d x))} \]

[In]

Integrate[Tan[c + d*x]^5/(a + I*a*Tan[c + d*x]),x]

[Out]

((-12*I)*Log[Cos[c + d*x]] + 3*(5 + 4*Log[Cos[c + d*x]])*Tan[c + d*x] + (9*I)*Tan[c + d*x]^2 + Tan[c + d*x]^3
- (2*I)*Tan[c + d*x]^4 - (15*I)*ArcTan[Tan[c + d*x]]*(-I + Tan[c + d*x]))/(6*a*d*(-I + Tan[c + d*x]))

Maple [A] (verified)

Time = 0.30 (sec) , antiderivative size = 101, normalized size of antiderivative = 0.93

method result size
risch \(-\frac {9 i x}{2 a}-\frac {{\mathrm e}^{-2 i \left (d x +c \right )}}{4 a d}-\frac {4 i c}{a d}-\frac {2 \left (6 \,{\mathrm e}^{4 i \left (d x +c \right )}+9 \,{\mathrm e}^{2 i \left (d x +c \right )}+7\right )}{3 d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}+\frac {2 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{a d}\) \(101\)
derivativedivides \(\frac {2 i \tan \left (d x +c \right )}{d a}-\frac {i \left (\tan ^{3}\left (d x +c \right )\right )}{3 d a}+\frac {\tan ^{2}\left (d x +c \right )}{2 a d}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d a}-\frac {5 i \arctan \left (\tan \left (d x +c \right )\right )}{2 d a}+\frac {i}{2 d a \left (\tan \left (d x +c \right )-i\right )}\) \(105\)
default \(\frac {2 i \tan \left (d x +c \right )}{d a}-\frac {i \left (\tan ^{3}\left (d x +c \right )\right )}{3 d a}+\frac {\tan ^{2}\left (d x +c \right )}{2 a d}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d a}-\frac {5 i \arctan \left (\tan \left (d x +c \right )\right )}{2 d a}+\frac {i}{2 d a \left (\tan \left (d x +c \right )-i\right )}\) \(105\)
norman \(\frac {-\frac {1}{a d}+\frac {\tan ^{4}\left (d x +c \right )}{2 a d}-\frac {5 i x}{2 a}+\frac {5 i \tan \left (d x +c \right )}{2 d a}+\frac {5 i \left (\tan ^{3}\left (d x +c \right )\right )}{3 d a}-\frac {i \left (\tan ^{5}\left (d x +c \right )\right )}{3 a d}-\frac {5 i x \left (\tan ^{2}\left (d x +c \right )\right )}{2 a}}{1+\tan ^{2}\left (d x +c \right )}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d a}\) \(130\)

[In]

int(tan(d*x+c)^5/(a+I*a*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-9/2*I*x/a-1/4/a/d*exp(-2*I*(d*x+c))-4*I/a/d*c-2/3*(6*exp(4*I*(d*x+c))+9*exp(2*I*(d*x+c))+7)/d/a/(exp(2*I*(d*x
+c))+1)^3+2/a/d*ln(exp(2*I*(d*x+c))+1)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.61 \[ \int \frac {\tan ^5(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {-54 i \, d x e^{\left (8 i \, d x + 8 i \, c\right )} - 3 \, {\left (54 i \, d x + 17\right )} e^{\left (6 i \, d x + 6 i \, c\right )} - 81 \, {\left (2 i \, d x + 1\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (-54 i \, d x - 65\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + 24 \, {\left (e^{\left (8 i \, d x + 8 i \, c\right )} + 3 \, e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, e^{\left (4 i \, d x + 4 i \, c\right )} + e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 3}{12 \, {\left (a d e^{\left (8 i \, d x + 8 i \, c\right )} + 3 \, a d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, a d e^{\left (4 i \, d x + 4 i \, c\right )} + a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )}} \]

[In]

integrate(tan(d*x+c)^5/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/12*(-54*I*d*x*e^(8*I*d*x + 8*I*c) - 3*(54*I*d*x + 17)*e^(6*I*d*x + 6*I*c) - 81*(2*I*d*x + 1)*e^(4*I*d*x + 4*
I*c) + (-54*I*d*x - 65)*e^(2*I*d*x + 2*I*c) + 24*(e^(8*I*d*x + 8*I*c) + 3*e^(6*I*d*x + 6*I*c) + 3*e^(4*I*d*x +
 4*I*c) + e^(2*I*d*x + 2*I*c))*log(e^(2*I*d*x + 2*I*c) + 1) - 3)/(a*d*e^(8*I*d*x + 8*I*c) + 3*a*d*e^(6*I*d*x +
 6*I*c) + 3*a*d*e^(4*I*d*x + 4*I*c) + a*d*e^(2*I*d*x + 2*I*c))

Sympy [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 197, normalized size of antiderivative = 1.81 \[ \int \frac {\tan ^5(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {- 12 e^{4 i c} e^{4 i d x} - 18 e^{2 i c} e^{2 i d x} - 14}{3 a d e^{6 i c} e^{6 i d x} + 9 a d e^{4 i c} e^{4 i d x} + 9 a d e^{2 i c} e^{2 i d x} + 3 a d} + \begin {cases} - \frac {e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text {for}\: a d e^{2 i c} \neq 0 \\x \left (\frac {\left (- 9 i e^{2 i c} + i\right ) e^{- 2 i c}}{2 a} + \frac {9 i}{2 a}\right ) & \text {otherwise} \end {cases} - \frac {9 i x}{2 a} + \frac {2 \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{a d} \]

[In]

integrate(tan(d*x+c)**5/(a+I*a*tan(d*x+c)),x)

[Out]

(-12*exp(4*I*c)*exp(4*I*d*x) - 18*exp(2*I*c)*exp(2*I*d*x) - 14)/(3*a*d*exp(6*I*c)*exp(6*I*d*x) + 9*a*d*exp(4*I
*c)*exp(4*I*d*x) + 9*a*d*exp(2*I*c)*exp(2*I*d*x) + 3*a*d) + Piecewise((-exp(-2*I*c)*exp(-2*I*d*x)/(4*a*d), Ne(
a*d*exp(2*I*c), 0)), (x*((-9*I*exp(2*I*c) + I)*exp(-2*I*c)/(2*a) + 9*I/(2*a)), True)) - 9*I*x/(2*a) + 2*log(ex
p(2*I*d*x) + exp(-2*I*c))/(a*d)

Maxima [F(-2)]

Exception generated. \[ \int \frac {\tan ^5(c+d x)}{a+i a \tan (c+d x)} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate(tan(d*x+c)^5/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negative exponent.

Giac [A] (verification not implemented)

none

Time = 1.61 (sec) , antiderivative size = 102, normalized size of antiderivative = 0.94 \[ \int \frac {\tan ^5(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {\frac {3 \, \log \left (\tan \left (d x + c\right ) + i\right )}{a} - \frac {27 \, \log \left (\tan \left (d x + c\right ) - i\right )}{a} + \frac {3 \, {\left (9 \, \tan \left (d x + c\right ) - 7 i\right )}}{a {\left (\tan \left (d x + c\right ) - i\right )}} - \frac {2 \, {\left (2 i \, a^{2} \tan \left (d x + c\right )^{3} - 3 \, a^{2} \tan \left (d x + c\right )^{2} - 12 i \, a^{2} \tan \left (d x + c\right )\right )}}{a^{3}}}{12 \, d} \]

[In]

integrate(tan(d*x+c)^5/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

1/12*(3*log(tan(d*x + c) + I)/a - 27*log(tan(d*x + c) - I)/a + 3*(9*tan(d*x + c) - 7*I)/(a*(tan(d*x + c) - I))
 - 2*(2*I*a^2*tan(d*x + c)^3 - 3*a^2*tan(d*x + c)^2 - 12*I*a^2*tan(d*x + c))/a^3)/d

Mupad [B] (verification not implemented)

Time = 4.27 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.97 \[ \int \frac {\tan ^5(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {{\mathrm {tan}\left (c+d\,x\right )}^2}{2\,a\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{4\,a\,d}+\frac {\mathrm {tan}\left (c+d\,x\right )\,2{}\mathrm {i}}{a\,d}-\frac {1}{2\,a\,d\,\left (1+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}-\frac {9\,\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )}{4\,a\,d}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^3\,1{}\mathrm {i}}{3\,a\,d} \]

[In]

int(tan(c + d*x)^5/(a + a*tan(c + d*x)*1i),x)

[Out]

log(tan(c + d*x) + 1i)/(4*a*d) - (9*log(tan(c + d*x) - 1i))/(4*a*d) + (tan(c + d*x)*2i)/(a*d) - 1/(2*a*d*(tan(
c + d*x)*1i + 1)) + tan(c + d*x)^2/(2*a*d) - (tan(c + d*x)^3*1i)/(3*a*d)